cmake_minimum_required(VERSION 2.4.6)
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)

# Set the build type.  Options are:
#  Coverage       : w/ debug symbols, w/o optimization, w/ code-coverage
#  Debug          : w/ debug symbols, w/o optimization
#  Release        : w/o debug symbols, w/ optimization
#  RelWithDebInfo : w/ debug symbols, w/ optimization
#  MinSizeRel     : w/o debug symbols, w/ optimization, stripped binaries
#set(ROS_BUILD_TYPE RelWithDebInfo)

rosbuild_init()

#set the default path for built executables to the "bin" directory
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
#set the default path for built libraries to the "lib" directory
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)

#uncomment if you have defined messages
# rosbuild_genmsg()
#uncomment if you have defined services
#rosbuild_gensrv()

#KomodoProject Nodes

# ADD TO PROJECT DOCUMENTATION:
# IF USING BOOST, ORDER SHOULD BE:
# 1. rosbuild_add_boost_directories()
# 2. rosbuild_add_library(// all libraries)
# 3. rosbuild_link_boost(NodeUsesBoost BoostSubLibrary)
# 4. rosbuild_add_executable(// all libraries)

rosbuild_add_boost_directories()

rosbuild_add_library(SensorsNode src/utilities/MsgParser.cpp)
rosbuild_add_library(SensorsNode src/SensorNode/SubsData.cpp)

rosbuild_add_library(RoverMngrNode src/utilities/XmlParser.cpp)
rosbuild_add_library(RoverMngrNode src/utilities/ThreadSafeQueue.h)
rosbuild_add_library(RoverMngrNode src/utilities/Event.cpp)
rosbuild_add_library(RoverMngrNode src/utilities/MsgParser.cpp)
rosbuild_add_library(RoverMngrNode src/utilities/ObjPosition.h)
rosbuild_add_library(RoverMngrNode src/RoverMngrNode/Driver.cpp)
rosbuild_add_library(RoverMngrNode src/RoverMngrNode/WallFollower.cpp)
rosbuild_add_library(RoverMngrNode src/RoverMngrNode/objectTracker/ColorTracker.cpp)
rosbuild_add_library(RoverMngrNode src/RoverMngrNode/obstacles/RandomWalk.cpp)

rosbuild_add_library(RoverMngrNode src/ArmMngrNode/ArmMover.cpp)


rosbuild_add_library(VisionNode src/utilities/XmlParser.cpp)
rosbuild_add_library(VisionNode src/utilities/ObjPosition.h)



# LINK BOOST TO EACH NODE THAT USES THIS LIBRARY
rosbuild_link_boost(RoverMngrNode thread)
rosbuild_link_boost(VisionNode thread)
rosbuild_link_boost(VisionNode signals)

# Important: ArmMover.cpp class uses threads, then if it will going to be separate
# Node - add line: "rosbuild_link_boost(ArmMngrNode thread)"




# Node For Testing:
# rosbuild_add_library(DemoNode src/ArmMngrNode/ArmMover.cpp) # temporary disabled
# rosbuild_add_executable(DemoNode src/DemoNode.cpp)

rosbuild_add_executable(RoverMngrNode src/RoverMngrNode/RoverMngrNode.cpp)
rosbuild_add_executable(SensorsNode src/SensorNode/SensorNode.cpp)
rosbuild_add_executable(VisionNode src/VisionNode/VisionNode.cpp)

# rosbuild_add_executable(DemoVisionNode src/DemoVisionNode.cpp)
rosbuild_add_library(ColorCalibration src/utilities/XmlParser.cpp)
rosbuild_add_executable(ColorCalibration src/utilities/ColorCalibration.cpp)


#rosbuild_add_library(${PROJECT_NAME} src/example.cpp)
#target_link_libraries(${PROJECT_NAME} another_library)
# rosbuild_add_boost_directories()
# rosbuild_link_boost(${PROJECT_NAME} thread)
#rosbuild_add_executable(example examples/example.cpp)
#target_link_libraries(example ${PROJECT_NAME})
